package com.tjhzzx.ibmsSupervisor.enums;

import javax.baja.sys.BFrozenEnum;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;

/**
 * @author Luc
 * @date 2019-11-14 22:13
 */
public final class BModuleType extends BFrozenEnum {
    public static final int DASHBOARD = 0;
    public static final int REALTIME = 1;
    public static final int HISTORY = 2;
    public static final int ALARM = 3;
    public static final int TREE_MENU = 4;
    public static final int PAGE = 5;
    public static final int URL = 6;
    public static final int IMAGE = 7;
    public static final int TEXT = 8;
//    public static final int USER = 7;
//    public static final int DHDRIVER = 8;
//    public static final int GAURD = 9;
//    public static final int VIDEO = 10;

    public static final BModuleType dashboard = new BModuleType(0);
    public static final BModuleType realtime = new BModuleType(1);
    public static final BModuleType history = new BModuleType(2);
    public static final BModuleType alarm = new BModuleType(3);
    public static final BModuleType treeMenu = new BModuleType(4);
    public static final BModuleType page = new BModuleType(5);
    public static final BModuleType url = new BModuleType(6);
    public static final BModuleType image = new BModuleType(7);
    public static final BModuleType text = new BModuleType(8);
//    public static final BModuleType user = new BModuleType(7);
//    public static final BModuleType dhDriver = new BModuleType(8);
//    public static final BModuleType guard = new BModuleType(9);
//    public static final BModuleType video = new BModuleType(10);

    public static final BModuleType DEFAULT = page;

    public BModuleType(int ordinal) {
        super(ordinal);
    }

    public static BModuleType make(int ordinal) {
        return (BModuleType) page.getRange().get(ordinal, false);
    }

    public static BModuleType make(String tag) {
        return (BModuleType) page.getRange().get(tag);
    }


    @Override
    public Type getType() {
        return TYPE;
    }

    public static final Type TYPE = Sys.loadType(BModuleType.class);
}
